from rest_framework.serializers import ModelSerializer

from course.models import CategoryModel


class Category(ModelSerializer):
    class Meta:
        model = CategoryModel
        fields = ['id','cname']

class CategorySer(ModelSerializer):
    children=Category(many=True)
    class Meta:
        model=CategoryModel
        fields='__all__'